package com.example.demo.dao.dataSource1;

import com.example.demo.entity.dataSource1.*;
import org.apache.catalina.User;
import org.springframework.cache.annotation.CachePut;

import java.util.List;
import java.util.Map;


public interface StoryMapper {

    StoryEntity select(int storyId);

    void insert(StoryEntity storyEntity);

    void update(StoryEntity storyEntity);

    StoryEntity selectBySourceTransmissionIdAndLanguage(Map<String, Object> parameters);

    StoryEntity selectByTransmissionIdAndLanguage(Map<String, Object> parameters);

    List<StoryEntity> selectByTransmissionIdAndIssueDate(Map<String, Object> parameters);

    StoryEntity selectByFileName(String fileName);

    StoryEntity selectLatestStoryByStoryNumber(String storyNumber);

    List<StoryEntity> selectForDailyDigest(Map<String, Object> parameters);

    int countByCondition(Map<String, Object> parameters);

    List<Integer> selectByPageAndCondition(Map<String, Object> parameters);

    List<Integer> selectRelatedStoryIds(Map<String, Object> parameters);



    // Tag related methods
    void insertTag(StoryToTagEntity entity);
    void deleteTagsByTypeAndStoryId(StoryToTagEntity entity);
    void deleteTagsByStoryId(int storyId);
    List<String> selectTagsByTypeAndStoryId(StoryToTagEntity entity);



    // Stock related methods
    void insertStock(StoryToStockEntity s2s);
    void deleteStocksByStoryId(int storyId);
    List<StoryToStockEntity> selectStocksByStoryId(int storyId);



    // Company related methods
    void insertCompany(StoryToCompanyEntity s2c);
    void deleteCompaniesByStoryId(int storyId);
    List<StoryToCompanyEntity> selectCompaniesByStoryId(int storyId);



    // Geography related methods
    void insertGeography(StoryToGeographyEntity entity);
    void updateGeography(StoryToGeographyEntity entity);
    GeographyEntity selectGeographyByStoryIdAndGeographyCode(StoryToGeographyEntity entity);
    List<GeographyEntity> selectGeographyListByStoryId(int storyId);
    List<StoryToGeographyEntity> selectStoryToGeographyByStoryId();
    StoryToGeographyEntity selectStoryToGeographyByStoryIdAndGeoCode();
    void deleteGeographiesByTypeAndStoryId(StoryToGeographyEntity entity);
    void deleteGeographiesByStoryId(int storyId);
    void deleteGeographiesByStoryIdAndGeoCode(StoryToGeographyEntity storyToGeographyEntity);

    List<String> selectGeographiesByTypeAndStoryId(StoryToGeographyEntity entity);


}
